import 'dart:convert' show json;

class CategoryParentResult {

  bool success;
  String code;
  String message;
  CategoryParentEntity entity;

  CategoryParentResult.fromParams({this.success, this.code, this.message, this.entity});

  factory CategoryParentResult(jsonStr) => jsonStr == null ? null : jsonStr is String ? new CategoryParentResult.fromJson(json.decode(jsonStr)) : new CategoryParentResult.fromJson(jsonStr);

  CategoryParentResult.fromJson(jsonRes) {
    success = jsonRes['success'];
    code = jsonRes['code'];
    message = jsonRes['message'];
    entity = jsonRes['entity'] == null ? null : new CategoryParentEntity.fromJson(jsonRes['entity']);
  }

  @override
  String toString() {
    return '{"success": $success,"code": ${code != null?'${json.encode(code)}':'null'},"message": ${message != null?'${json.encode(message)}':'null'},"entity": $entity}';
  }
}

class CategoryParentEntity {

  CategoryParentResponse goods_opt_get_response;

  CategoryParentEntity.fromParams({this.goods_opt_get_response});

  CategoryParentEntity.fromJson(jsonRes) {
    goods_opt_get_response = jsonRes['goods_opt_get_response'] == null ? null : new CategoryParentResponse.fromJson(jsonRes['goods_opt_get_response']);
  }

  @override
  String toString() {
    return '{"goods_opt_get_response": $goods_opt_get_response}';
  }
}

class CategoryParentResponse {

  List<CategoryParentBean> goods_opt_list;

  CategoryParentResponse.fromParams({this.goods_opt_list});

  CategoryParentResponse.fromJson(jsonRes) {
    goods_opt_list = jsonRes['goods_opt_list'] == null ? null : [];

    for (var goods_opt_listItem in goods_opt_list == null ? [] : jsonRes['goods_opt_list']){
      goods_opt_list.add(goods_opt_listItem == null ? null : new CategoryParentBean.fromJson(goods_opt_listItem));
    }
  }

  @override
  String toString() {
    return '{"goods_opt_list": $goods_opt_list}';
  }
}

class CategoryParentBean {

  Object id;
  Object image;
  int level;
  int opt_id;
  int parent_opt_id;
  String opt_name;

  CategoryParentBean.fromParams({this.id, this.image, this.level, this.opt_id, this.parent_opt_id, this.opt_name});

  CategoryParentBean.fromJson(jsonRes) {
    id = jsonRes['id'];
    image = jsonRes['image'];
    level = jsonRes['level'];
    opt_id = jsonRes['opt_id'];
    parent_opt_id = jsonRes['parent_opt_id'];
    opt_name = jsonRes['opt_name'];
  }

  @override
  String toString() {
    return '{"id": $id,"image": $image,"level": $level,"opt_id": $opt_id,"parent_opt_id": $parent_opt_id,"opt_name": ${opt_name != null?'${json.encode(opt_name)}':'null'}}';
  }
}

